<?php
class LogWorker
{
    public static function log($job)
    {
        // params
        $params = array_merge(array(uniqid(), date('Y-m-d H:i:s')), unserialize($job->workload()));

        // log
        $filename = Yii::getPathOfAlias('application.runtime.scribe').'.log';
        $data = implode('|', $params)."\n";
        file_put_contents($filename, $data, FILE_APPEND);
    }
}